<template>
	<view class="container">
		<!-- 头部 -->
		<tui-navigation-bar backgroundColor="" :isOpacity="false" >
			<view class="tui-content-box">
				<view>
					<tui-icon name="arrowleft" color="#ffffff" @click="backTo"></tui-icon>
				</view>
				<view class="tui-content-tit">
					<view>我的团队</view>
				</view>
			</view>
		</tui-navigation-bar>
		
		
		
		
		
		<view class="user-section">
			<view class="yuncang-top-box">
				<view class="yuncang-tixian">
					<view class="profit">{{total?total:"0"}}</text></view>
					<view class="profit-title">团队人数(人)</view>
				</view>
			</view>
		</view>
				
		<view>
			<view class="wrap" v-for="(item,index) in wrapList" :key="item.key">
				<view class="wrap_img">
					<image :src="item.avatar" mode=""></image>
				</view>
				<view class="wrap_tit">
					<view class="wrap_top">
						<view class="wrap_name">{{item.username}}</view>
						<view class="wrap_panner">
							<image :src="item.partner" mode=""></image>
						</view>
					</view>
					<view class="wrap_bottom">
						<view>加入时间：{{item.addTime}}</view>
						<view>已消费:¥{{item.consume?item.consume:0}}</view>
					</view>
				</view>
			</view>
			<!-- 空白页 -->
			<empty v-if="total === 0"></empty>
			<!-- <view class="no-data">
				<p>~没有更多内容~</p>
			</view> -->
			
			
		</view>
		
		
	</view>
</template>
<script>
	import empty from "@/components/myteam.vue";
	export default {
		components: {
			empty
		},
		data() {
			return {
				wrapList:[],
				total:"",
			}
		},

		onLoad() {
			this.loadData()

		},

		methods: {
			//返回
			backTo(){
				uni.navigateBack({
					
				})
			},
			loadData(){
				this.tui.request(
					'/app/profit/team',
					'GET', 
					{
						
					},
					false,
					false,
					false,
				).then(res => {
					if (res.errno == 0) {
						this.wrapList = res.data.list
						this.total = res.data.total
					}
				}).catch(err => {
					console.log(err)
				})
				
			}
		}
	}
</script>
<style lang='scss'>
	page {
		background: #FAFAFA;
	}

	%flex-center {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	%section {
		display: flex;
		justify-content: space-between;
		align-content: center;
		background: #fff;
		border-radius: 10upx;
	}
	
	/*navigation-bar*/
	.navigationBar{
		background: url(../../static/img/yuncang/yuncang.png) no-repeat;
		background-size: 100% 600upx;
	}
	.tui-content-box {
		width: 100%;
		height: 44px;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		
	}
		
	.tui-content-tit{
		width: 100%;
		height: 56upx;
		margin: 0 100rpx;
		color: #ffffff;
		font-size: 18px;
		padding: 0 12px;
		text-align: center;
		margin-left: 46rpx;
	}
	
	.tui-search-box {
		width: 100%;
		height: 56upx;
		margin: 0 100rpx;
		border-radius: 18px;
		font-size: 14px;
		padding: 0 12px;
		box-sizing: border-box;
		color: #bfbfbf;
		display: flex;
		align-items: center;
		background-color: rgba(255, 255, 255, .2);
	}
	
	.tui-search-text {
		color: #ffffff;
		padding-left: 10rpx;
	}
	
	

	.user-section {
		width: 100%;
		background: url(../../static/img/yuncang/yuncang.png) no-repeat;
		background-size:100% 100%;
		padding: 158upx 34px 158upx;
		position: relative;

		.top-bar{
			padding-top: 10px;
			height: 44px;
			line-height: 44px;
			color: #fff;
			font-size: 22px;
			text-align: center;
		}
	}
	
	.yuncang-top-box{
		/* margin-top: 80upx; */
		color: #fff;
		
		.yuncang-tixian{
			text-align: center;
			.profit{
				position: relative;
				font-size:70upx;
				font-weight:800;
				.tixian{
					position: absolute;
					top: 0;
					margin-left: 8upx;
					width: 60upx;
					height: 34upx;
					background: url(../../static/img/yuncang/cloud_withdraw.png) no-repeat;
					background-size: 100% 100%;
				}
			}
			.profit-title{
				font-size:28upx;
				font-weight:500;
			}
		}
		
		.yuncang-shouyi{
			display: flex;
			justify-content: space-around;
			align-content: center;
			
			.shouyi-item{
				@extend %flex-center;
				margin-top: 40upx;
				
				.profit{
					font-size:34upx;
					font-weight:bold;
				}
				.profit-title{
					font-size:20upx;
					font-weight:500;
				}
			}
			
			.line{
				margin-top: 20px;
				width:1px;
				height:70upx;
				background: #fff;
			}
		}
	}
	
	.wrap{
		padding: 20upx 20upx;
		display: flex;
		align-items: center;
		background-color: #ffffff;
		border-bottom: 1px solid rgba(242,242,242,1);
		
		.wrap_img{
			width: 15%;
			text-align: center;
				
			image{
				width: 90upx;
				height: 90upx;
				border-radius: 50%;
			}
		}
		
		.wrap_tit{
			width: 85%;
			color: #333333;
			font-size: 14px;
			padding-left: 18upx;
			
			.wrap_top{
				display: flex;
				align-items: center;
				
				.wrap_name{
					font-size:32upx;
					font-family:PingFang SC;
					font-weight:400;
					color:rgba(51,51,51,1);
					line-height:29px;
					padding-right: 12upx;
				}
				.wrap_panner{
					
					image{
						width: 95upx;
						height: 26upx;
					}
				}
				
				
			}
			.wrap_bottom{
				display: flex;
				align-items: center;
				justify-content: space-between;
				
				font-size:24upx;
				font-family:PingFang SC;
				font-weight:400;
				color:rgba(153,153,153,1);
				line-height:29px;
				
				
			}
			
		}
		
	}
	/* 暂无数据 */
	.no-data {
		font-size: 24upx;
		line-height: 40upx;
		margin: 50upx 0;
		text-align: center;
		color: #CCCCCC;
	}
</style>
